package com.alipay.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 *  支付宝参数读取配置
 */
@Component
public class PayConfig implements InitializingBean {

    @Value("${PAY.ZFB.URL}")
    private String URLs;
    @Value("${PAY.ZFB.APP_ID}")
    private String APP_IDs;
    @Value("${PAY.ZFB.APP_PRIVATE_KEY}")
    private String APP_PRIVATE_KEYs;
    @Value("${PAY.ZFB.FORMAT}")
    private String FORMATs;
    @Value("${PAY.ZFB.ALIPAY_PUBLIC_KEY}")
    private String ALIPAY_PUBLIC_KEYs;
    @Value("${PAY.ZFB.SIGN_TYPE}")
    private String SIGN_TYPEs;


    public static String URL;

    public static String APP_ID;

    public static String APP_PRIVATE_KEY;
    public static String FORMAT;
    public static String ALIPAY_PUBLIC_KEY;
    public static String SIGN_TYPE;

    @Override
    public void afterPropertiesSet() throws Exception {

        URL = URLs;
        APP_ID = APP_IDs;
        APP_PRIVATE_KEY = APP_PRIVATE_KEYs;
        FORMAT = FORMATs;
        ALIPAY_PUBLIC_KEY = ALIPAY_PUBLIC_KEYs;
        SIGN_TYPE = SIGN_TYPEs;
    }
}
